package com.learn.my;

import java.util.concurrent.ConcurrentLinkedQueue;

public class Test0001 {


    public static void main(String[] args){
        //非阻塞队列，无界
        ConcurrentLinkedQueue<String> stringConcurrentLinkedQueue=new ConcurrentLinkedQueue<String>();

        stringConcurrentLinkedQueue.offer("张三");
        stringConcurrentLinkedQueue.offer("李四");
        stringConcurrentLinkedQueue.offer("小军");
        stringConcurrentLinkedQueue.offer("小红");

        //获取队列
        System.out.println(stringConcurrentLinkedQueue.poll());
        //获取队列个数
        System.out.println(stringConcurrentLinkedQueue.size());
    }
}
